package com.lz.ccjdemo.act;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.support.annotation.Nullable;

import com.lz.ccjdemo.R;

/**
 * 启动页
 * 可设置动画，图片 等内容
 * 将这个页面设置为启动页
 * <p>AndroidManifest  Activity
 * <intent-filter>
 * <action android:name="android.intent.action.MAIN" />
 * <p>
 * <category android:name="android.intent.category.LAUNCHER" />
 * </intent-filter>
 * <p>
 * 需要搭配
 * <p>AndroidManifest  Activity 中添加主题
 * android:theme="@style/FullScreenTheme"
 */
public class SplashActivity extends Activity {
    Handler handler;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_splash);
        handler = new Handler();
        handler.postDelayed(new Runnable() {
            @Override
            public void run() {
                //展示动画 或者页面结束后 跳转真正的主页
                startActivity(new Intent(SplashActivity.this, MainActivity.class));
                finish();
            }
        }, 1000);
    }
}
